@import 'base/variables';
@import 'base/font';
@import 'base/mixins';
@import 'base/animation';
@import 'controls';
@import 'stage';
@import 'kc-toggle';

[id^='frmb-'][id$='-form-wrap'] {
  @import 'base/bs';
}

textarea.idea-template {
  display: none;
  width: 617px;
  color: $off-white;
  font: 13px/19px courier;
  padding-left: 40px;
  height: 1055px;
}

.template-textarea-wrap {
  display: none;
}

.form-wrap {
  position: relative;
}

.form-wrap:after {
  content: '';
  display: table;
  clear: both;
}

.cb-wrap,
.stage-wrap {
  vertical-align: top;
}

.action-links .action-links-inner {
  overflow: hidden;
  width: 0;
  height: 20px;
  transition: width 250ms;
}

.action-links .dev-mode-link {
  transition: color 250ms;
  color: $grey;
  cursor: pointer;
  padding-right: 2px;
}

.stage-wrap h4 {
  margin-top: 0;
  color: $grey;
}

.action-links a.clear-all:hover,
.del-button:hover,
ul.frmb span.required {
  color: $error;
}

.action-links a {
  color: $grey;
}

.form-elements input[type=text].error {
  -webkit-border-radius: 0;
  border-radius: 0;
  border: 1px solid $error;
}

.form-elements input[type=text].fld-maxlength {
  width: 10%;
}

.form-elements input.field-error {
  background: $off-white;
  border: 1px solid #afafab;
}

.form-elements label em {
  display: block;
  font-weight: 400;
  font-size: .75em;
}

.form-elements label.maxlength-label {
  line-height: 1em;
}

.form-group .available-roles {
  display: none;
  padding: 10px;
  margin: 10px 0;
  background: darken($white, 10%);
  box-shadow: inset 0 0 2px 0 #999;

  @include breakpoint('phone-lrg') {
    margin-left: 0;
  }
}

.form-elements .available-roles label {
  font-weight: 400;
  width: auto;
  float: none;
  display: inline;
}

.form-elements .available-roles input {
  display: inline;
  top: auto;
}

.form-elements,
.form-group,
.multi-row span,
textarea {
  display: block;
}

.form-elements:after,
.form-group:after {
  content: '.';
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

.form-elements .field-options div:hover,
.frmb .legend,
.frmb .prev-holder,
.frmb .prev-holder * {
  cursor: move;
}

// tooltips
.frmb-tt {
  position: absolute;
  border: 1px solid darken($grey, 25%);
  background-color: $grey;
  border-radius: 5px;
  padding: 5px;
  color: $white;
  z-index: 20;
  text-align: left;
  font-size: 12px;
  pointer-events: none;

  &:before {
    border-color: darken($grey, 25%) transparent;
    bottom: -11px;
  }

  &:before,
  &:after {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 10px 10px 0;
    border-color: #666 transparent;
    display: block;
    width: 0;
    z-index: 1;
    margin-left: -10px;
    bottom: -10px;
    left: 20px;
  }

  a {
    text-decoration: underline;
    color: $white;
  }
}

.frmb li {
  &:hover,
  .fb-mobile & {
    .del-button,
    .toggle-form {
      opacity: 1;
    }
  }
}

.fresh .frmb .legend .element-info {
  display: inline-block;
  visibility: visible;
  line-height: 12px;
  margin-left: 6px;
}

.frmb-xml pre.ui-dialog-content {
  white-space: pre-wrap;
  white-space: -moz-pre-wrap;
  white-space: -pre-wrap;
  white-space: -o-pre-wrap;
  word-wrap: break-word;
  font-size: 12px;
  padding: 0 30px;
  margin-top: 0;
}

.action-links a.export-xml:hover,
.toggle-form.closed:hover {
  color: #6fc245;
}

.toggle-form.open {
  // line-height: 14px;
}

a.btn.toggle-form {
  margin-left: 5px;
  opacity: 0;

  &:hover {
    border-color: lighten($grey, 40%);
  }

  &:before {
    margin: 0;
  }
}

.formb-field-vars .copy-var {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: #999;
  text-indent: -9999px;
}

.ite-warning {
  box-shadow: 1px 1px 4px 0 rgba(50, 50, 50, 0.5);
  border-radius: 0;
  border: 1px solid #ddd;
}

.ite-warning .ui-dialog-buttonpane {
  height: 27px;
}

.ite-warning button {
  color: #4479B9;
  margin: 0;
}

.ite-warning button:focus {
  outline: 0;
  font-weight: 700;
}

.ite-warning button.cancel:before {
  content: '|';
  margin-right: 15px;
  padding: 0;
}

.ite-warning .ui-dialog-content {
  padding: 0 15px 10px;
}

.ite-warning .ui-dialog-titlebar-close {
  display: none;
}

.ite-warning .ui-widget-header {
  height: 15px;
}

.ite-warning {
  font-size: 12px;
  line-height: 1.5em;
}

.ite-warning h3 {
  color: $grey;
  margin-bottom: 10px;
}

.ite-warning button {
  background: 0 0;
  padding: 2px 5px;
}

.required-asterisk {
  display: none;
  color: $error;
}

.ui-button {
  .ui-button-text {
    line-height: 0;
  }
}

.form-builder-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 10;

  &.visible {
    display: block;
  }
}

.form-builder-dialog {
  position: absolute;
  border-radius: 5px;
  background: $white;
  z-index: 20;
  transform: translate(-50%, -50%);
  top: 0;
  left: 0;
  padding: 10px;
  box-shadow: 0 3px 10px $black;

  h3 {
    margin-top: 0;
  }

  &.data-dialog {
    width: 65%;
    background-color: #23241f;

    pre {
      background: none;
      border: 0 none;
      box-shadow: none;
      margin: 0;
      color: darken($white, 5%);
    }
  }

  &.positioned {
    transform: translate(-50%, -100%);

    .button-wrap {
      &:before {
        content: '';
        width: 0;
        height: 0;
        border-left: 15px solid transparent;
        border-right: 15px solid transparent;
        border-top: 10px solid $white;
        position: absolute;
        left: 50%;
        top: 100%;
        transform: translate(-50%, 10px);
      }
    }
  }

  .button-wrap {
    position: relative;
    margin-top: 10px;
    text-align: right;
    clear: both;

    .btn {
      margin-left: 10px;
    }
  }
}
